Skip to content

Sweep e2e leftovers from the preview account nightly - #963

Merged
RhysSullivan merged 1 commit into
mainfrom
claude/sweep-e2e
Jun 12, 2026
Merged

Sweep e2e leftovers from the preview account nightly#963
RhysSullivan merged 1 commit into
mainfrom
claude/sweep-e2e

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

The e2e harness shares the preview Cloudflare account and leaks two resource classes: suite runs that crash before their teardown leave an executor-e2e-<hex> worker + D1 + Access app trio behind, and every real Access OTP login by a synthetic e2e identity permanently occupies a Zero Trust seat (50 on the free plan). Both recently piled up enough to hit account limits — 7 orphaned stacks against the 10-database D1 cap, and 29 of 50 seats.

preview.ts gains a sweep-e2e subcommand:

  • Deletes executor-e2e-<8 hex> stacks (worker with ?force=true, its D1, its Access app) older than 24h — younger ones may belong to a live suite run, and the persistent fixed-name workers (OTP capture, emulators, state store) don't match the stack pattern.
  • Revokes Zero Trust seats held by the synthetic e2e login domain via the seats PATCH API. User records remain; they just stop counting against the quota.

The nightly sweep workflow runs it after the existing PR-preview pass, with the same token/account env. The deploy token needed one extra scope — Access: Users Write — which has been added to the account's scoped token (verified: it can now list users and patch seats).

Verified locally against the (already-clean) account: {"deletedStacks":[],"revokedSeats":0} — correctly deletes nothing when there's nothing to delete.

The e2e harness shares the preview Cloudflare account and leaks two
resource classes: suite runs that crash before their teardown leave an
executor-e2e-<hex> worker + D1 + Access app trio behind, and every real
Access OTP login by a synthetic ci-…@executor-dev.xyz identity
permanently occupies a Zero Trust seat (50 on the free plan). Both
recently piled up enough to hit account limits (7 orphaned stacks at
the 10-database D1 cap, 29 of 50 seats).

preview.ts gains a sweep-e2e subcommand that deletes e2e stacks older
than a day (live suite runs are younger; the persistent OTP/emulator/
state-store workers don't match the stack pattern) and revokes seats
held by the synthetic e2e domain, and the nightly sweep workflow runs
it after the PR-preview pass. Requires the deploy token to carry
Access: Users Write (added to the account token).
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing a5990b1 Commit Preview URL

Branch Preview URL
Jun 12 2026, 03:26 AM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud a5990b1 Jun 12 2026, 03:26 AM

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

@RhysSullivan
RhysSullivan merged commit e5bc074 into main Jun 12, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant